package cn.wolfcode.wolf2w.search.service.impl;

import cn.wolfcode.wolf2w.domain.Strategy;
import cn.wolfcode.wolf2w.search.domain.StrategyEs;
import cn.wolfcode.wolf2w.search.repository.StrategyESRepository;
import cn.wolfcode.wolf2w.search.service.IStrategyESService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StrategyESImpl implements IStrategyESService {
    
    @Autowired
    private StrategyESRepository strategyESRepository;
    @Override
    public void insert(StrategyEs strategyEs) {
        strategyESRepository.save(strategyEs);
    }

    //通过目的地名称查出所有的攻略
    @Override
    public List<Strategy> queryByDestName(String name) {
        List<Strategy> strategies = strategyESRepository.queryByDestName(name);
        return strategies;
    }
}
